<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JQuery Dialog</title>
<link rel="stylesheet" type="text/css" href="../lib/jqueryui/css/custom-theme/jquery-ui-1.8.23.custom.css" />
<script language="javascript" type="text/javascript" src="../lib/jqueryui/js/jquery-1.8.0.min.js"></script>
<script language="javascript" type="text/javascript" src="../lib/jqueryui/js/jquery-ui-1.8.23.custom.min.js"></script>
</head>

<body>
<div id="mywin"></div>
<div id="yourwin"></div>
<script language="javascript" type="text/javascript">
	$(document).ready(function(e) {
        $("#mywin").dialog({
			focus:function(){alert("mywin");}
		});

        $("#yourwin").dialog({
			focus:function(){alert("yourwin");}
		});
		
    });
</script>

<script language="javascript" type="text/javascript">
	$(document).keydown(function(e){
		if(e.keyCode==38)
		{
			if($("#khachhang_flex tr.trSelected").is("#khachhang_flex tr:first")) return;
			var id=$("#khachhang_flex tr.trSelected").prev().attr("id");
			$("#khachhang_flex tr.trSelected").toggleClass("trSelected");
			$("#khachhang_flex #"+id).toggleClass("trSelected");
		}
		else if(e.keyCode==40)
		{
			if($("#khachhang_flex tr.trSelected").is("#khachhang_flex tr:last")) return;
			var id=$("#khachhang_flex tr.trSelected").next().attr("id");
			$("#khachhang_flex tr.trSelected").toggleClass("trSelected");
			$("#khachhang_flex #"+id).toggleClass("trSelected");
		}
	});
</script>

</body>
</html>